<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>管理人员绑定</title>
    <link rel="stylesheet" th:href="@{/static/adminBind/style/weui.css}">
    <link rel="stylesheet" th:href="@{/static/adminBind/style/style.css}">
    <!-- <script src="js/zepto.min.js"></script> -->
    <script th:src="@{/static/adminBind/js/jquery-3.4.1.min.js}"></script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
    <script th:src="@{/static/adminBind/js/weui.min.js}"></script>

</head>

<body>
    <div class="weui-toptips weui-toptips_warn js_tooltips">错误提示</div>
    <div class="page">
        <div class="weui-form">
            <div class="weui-form__text-area">
                <h2 class="weui-form__title" style="text-align: left;">绑定虎爪速派管理平台账号</h2>
                <div class="weui-form__desc" style="text-align: left;">便于更好的管理审核人员</div>
            </div>
            <div class="weui-form__control-area">
                <div class="weui-cells__group weui-cells__group_form">
                    <!-- <div class="weui-cells__title">表单报错：置顶tipsbar报错信息</div> -->
                    <div class="weui-cells weui-cells_form">
                        <div class="weui-cell weui-cell_active" id="js_cell">
                            <div class="weui-cell__hd"><label class="weui-label">账号</label></div>
                            <div class="weui-cell__bd weui-flex">
                                <input id="js_input" class="weui-input" autofocus type="text" name=""
                                    placeholder="请输入用户名" maxlength="16" />
                            </div>
                        </div>
                        <div class="weui-cell weui-cell_active">
                            <div class="weui-cell__hd"><label class="weui-label">密码</label></div>
                            <div class="weui-cell__bd weui-flex">
                                <input class="weui-input" type="password" placeholder="请输入密码" id="js_pass" />
                            </div>
                        </div>
                    </div>
                </div>

            </div>
            <div class="weui-form__opr-area">
                <a class="weui-btn weui-btn_primary" href="javascript:;" id="showTooltips">确定</a>
            </div>
        </div>
        <div id="js_toast" style="display: none;">
            <div class="weui-mask_transparent"></div>
            <div class="weui-toast">
                <i class="weui-icon-success-no-circle weui-icon_toast"></i>
                <p class="weui-toast__content">已完成</p>
            </div>
        </div>
    </div>
    <!-- result -->
    <div id="resultBox">
        <img style="width: 50%;" src="./images/pay-succes.png"/>
        <p>绑定成功</p>
        <span>您将会收到企业审核与工单审核通知</span>

    </div>
    <script src="./js/my.js"></script>
    <script type="text/javascript">
        
        $(function () {
            var $tooltips = $('.js_tooltips');
            var $toast = $('#js_toast');
            var $inputName = $('#js_input');
            var $cell = $('#js_cell');
            var $inputPass = $("#js_pass");
            var $code = getUrlVal("code");        //wxcode
            $('#showTooltips').on('click', function () {


                var $name = $inputName.val();
                var $pass = $inputPass.val();
                // toptips的fixed, 如果有`animation`, `position: fixed`不生效
                $('.page.cell').removeClass('slideIn');

                if (!$name) {
                    $tooltips.text("请输入账号")
                    $cell.addClass('weui-cell_warn');
                    $tooltips.fadeIn(100);
                    setTimeout(function () {
                        $tooltips.fadeOut(100);
                    }, 2000);
                } else if (!$pass) {
                    $tooltips.text("请输入密码")
                    $cell.addClass('weui-cell_warn');
                    $tooltips.fadeIn(100);
                    setTimeout(function () {
                        $tooltips.fadeOut(100);
                    }, 2000);
                } else {
                    let _postData = {
                        loginName: $name,
                        password: $pass
                    }

                    adminLogin(_postData).then(adminLoginRes=>{

                    })
                    // $("#resultBox").css("display","flex")
                    // $toast.fadeIn(100);
                    // setTimeout(function () {
                    //     $toast.fadeOut(100);
                    // }, 2000);
                }
            });
        });

        
    </script>
</body>

</html>